package com.dynamicdatasource.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.dynamicdatasource.annotation.DataSource;
import com.dynamicdatasource.config.DynamicDbConfig;

@Mapper
public interface DbTest {
	@DataSource(DynamicDbConfig.DATASOURCE_MASTER)
	@Select(value="select * from wap_param_conf")
	public List<Map<String,Object>> selectMaster();
	
	@DataSource(DynamicDbConfig.DATASOURCE_SLAVE)
	@Select(value="select * from wap_param_conf")
	public List<Map<String,Object>> selectSlave();
	
	
	@Insert(value="insert into wap_test (fname) values(#{fname})")
	public void insertWapTest(@Param(value="fname") String fname);
}
